function details(hzdh) {
	var $win;
	$win = $('#yhxxDetails').window({
	    title: '详情',
	    width: 1020,
	    height: 450,
//	    top: ($(window).height() - 820) * 0.5,
//	    left: ($(window).width() - 450) * 0.5,
	    shadow: true,
	    modal: true,
//	    iconCls: 'icon-add',
	    closed: true,
	    minimizable: false,
	    maximizable: true,
	    maximized: true,  
	    collapsible: true
	});

	$win.window('open');
	
//	$('#yhxxDetails').window('open');
	$('#dgDetails').datagrid({
		height : backendCommon.getHeight(0.88),
		loadMsg : "数据装载中,请稍等....",
		url : mainDomain + '/btsb/shreportmxlist.action?hzdh='+hzdh,
		nowrap : false,
		rownumbers : true,
		fitColumns : false,
		pagination : true,
		singleSelect : true,
		pageSize : 10,
		pageNumber : 1,
		pageList : [ 10, 15, 20 ],
		columns : [ [ {
			field : 'hzdh',
			title : '申报编号',
			width : $(this).width() * 0.08,
			align : 'center'
		}, {
			field : 'yslx',
			title : '运输类型',
			width : $(this).width() * 0.05,
			align : 'center',
			formatter : function(value, rec, index) {
				if("1"==value){
					return (!value) ? "暂无" : "铁水";
				}else if("2"==value){
					return (!value) ? "暂无" : "水铁";
				}
			}
		}, {
			field : 'mylx',
			title : '贸易类型',
			width : $(this).width() * 0.05,
			align : 'center',
			formatter : function(value, rec, index) {
				if("1"==value){
					return (!value) ? "暂无" : "内贸";
				}else if("2"==value){
					return (!value) ? "暂无" : "外贸";
				}
			}
		}, {
			field : 'xh',
			title : '箱号',
			width : $(this).width() * 0.08,
			align : 'center'
		}, {
			field : 'hwlx',
			title : '货物类型',
			width : $(this).width() * 0.05,
			align : 'center',
			formatter : function(value, rec, index) {
				return (!rec.hwlxinfoVO) ? "暂无" : rec.hwlxinfoVO.hwlxmc;
			}
		}, {
			field : 'xx',
			title : '箱型',
			width : $(this).width() * 0.05,
			align : 'center',
			formatter : function(value, rec, index) {
				return (!rec.xxinfoVO) ? "暂无" : rec.xxinfoVO.xxmc;
			}
		}, {
			field : 'crtlsj',
			title : '出/入铁路站场时间',
			width : $(this).width() * 0.10,
			align : 'center',
			formatter : function(value, rec, index) {
				return (!value) ? "暂无" : backendCommon.dateTimeToLocalStringDays(value);
			}
		}, {
			field : 'tlhph',
			title : '铁路货票号',
			width : $(this).width() * 0.10,
			align : 'center',
			formatter : function(value, rec, index) {
				return (!value) ? "暂无" : '<a href=' + rec.tlzpmc + ' style="color:blue" target="_blank">'+ rec.tlhph +'</a>';
			}
		}, {
			field : 'crgksj',
			title : '出/入港口时间',
			width : $(this).width() * 0.10,
			align : 'center',
			formatter : function(value, rec, index) {
				return (!value) ? "暂无" : backendCommon.dateTimeToLocalStringDays(value);
			}
		}, {
			field : 'hwydh',
			title : '货物运单号',
			width : $(this).width() * 0.12,
			align : 'center',
			formatter : function(value, rec, index) {
				return (!value) ? "暂无" : '<a href=' + rec.slzpmc + ' style="color:blue" target="_blank">'+ rec.hwydh +'</a>';
			}
		}, {
			field : 'sfsc',
			title : '轨迹查询',
			width : $(this).width() * 0.08,
			align : 'center',
			formatter : function(value, rec, index) {
				return "<a href='http://www.whxgedi.gov.cn/cms/control/gisMap' style='color:blue' target='_blank'>轨迹查询</a>";
			}
		}, {
			field : 'ishc',
			title : '状态',
			width : $(this).width() * 0.05,
			align : 'center',
			formatter : function(value, rec, index) {
				if(0==value){
					return "待审核";
				}else if(1==value){
					return "通过";
				}else{
					return "未通过";
				}
			}
		} ] ]
	});
}


function doSearch(){
	$('#yhxxDatagrid').datagrid('load',{
		qyqc: $('#qyqc').val(),
		sbnf: $('#sbnf').val(),
		sbjd: $('#sbjd').val(),
		hzzt: $('#hzzt').val()
	});
}

function qyqcFormatter(val, row) {
	if (!val) {
		return val;
	}
	return '<a href="javascript:void(0)" onclick="javascript:details(' + row.id
			+ ');">' + val + '</a>';
}

function qcFormatter(val, row) {
	return (!row.yhxxVO) ? "暂无" : row.yhxxVO.qyqc;
}

function sbjdFormatter(val, row) {
	return (!val) ? "暂无" : row.sbnf.toString()+"年第"+val + "季度";
}

function ztFormatter(val, row) {
	if(row.hzzt==0){
		return "待发起";
	}else if(row.hzzt==1){
		return "待比对";
	}else if(row.hzzt==2){
		return "待审核";
	}else if(row.hzzt==3){
		return "通过";
	}else if(row.hzzt==4){
		return "未通过";
	}else{
		return "待材料审核确认";
	}
}

function optFormatter(val, row) {
	var oprate = "";
	if(row.hzzt>1){
		oprate += "<div><a class='btn_blue06'  id='editbtn' onclick='javascript:details(\""+ row.hzdh + "\")' href='javascript:void(0)'>查看详情</a></div>";
	}
	return oprate;
}

function rqFormatter(val, row) {
	return (!val) ? "暂无" : backendCommon.dateTimeToLocalStringDays(val);
}

function exportexcel(){
	$('#shreportform').attr('action',mainDomain + '/btsb/export/shreportExcelView.action');
	$('#shreportform').submit();
}